package com.heima.article.feign;

import com.heima.feign.client.ArticleFeignClient;
import com.heima.article.service.IApArticleService;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author Gareth Cao
 * @date 2022/6/17 22:09
 */
public class ArticleClient implements ArticleFeignClient {
    @Autowired
    private IApArticleService apArticleService;

    @Override
    @PostMapping("/api/v1/article/save")
    public ResponseResult saveArticle(ArticleDto dto) {
       ResponseResult responseResult = apArticleService.saveArticle(dto);
        return responseResult;
    }
}
